package com.opengroupe.service.pc;

import java.util.List;

import com.opengroupe.dto.CandidatDto;
import com.opengroupe.entities.Candidat;
import com.opengroupe.entities.Categorie;
import com.opengroupe.entities.Question;
import com.opengroupe.entities.Reponse;
import com.opengroupe.util.QrhException;

/**
 * Ensemble des fonctionnalités nécessaires à l'administration de QRH
 * 
 */
public interface PCService {
	
	/**
	 * Creates a new {@link Question} into database with the 
	 * given object.
	 * 
	 * @param question to be persisted
	 * @return persisted object.
	 * @throws Exception 
	 */
	public Question creerQuestion(Question question) throws Exception;
	
	/**
	 * Met a jour le contenu de la question et/ou ses differentes 
	 * reponses possibles et correctes.
	 * 
	 * @param question {@link Question}
	 * @return {@link Question}
	 */
	public Question modifierQuestion(Question question) throws QrhException;
	
	/**
	 * Removes from database the {@link Candidat} with the specified email
	 * 
	 * @param emailCandidat
	 */
	public void deleteCandidat(final String emailCandidat);
	
	/**
	 * Removes from database the {@link Question} with the specified id
	 * 
	 * @param idQuestion
	 */
	public void deleteQuestion(final long idQuestion);
	
	/**
	 * Met à jour le libellé d'une catégorie
	 * @param integer
	 * @return
	 */
	public Categorie modifierCategorie(Integer idCategorie, String libelleCategorie) throws Exception;
	
	/**
	 * Met à jour un candidat en prenant un candidatDto en paramètre
	 * @param candidatDto
	 * @return
	 * @throws Exception 
	 */
	public CandidatDto modifierCandidat(CandidatDto candidatDto) throws Exception;
	
	/**
	 * Ajoute des réponses Eventuelles à une question
	 * @param idQuestion
	 * @param idReponses
	 * @return
	 * @throws Exception 
	 */
	public Question addReponsesEventuellesToQuestion(String idQuestion,List<String> idReponses) throws Exception;

	/**
	 * Ajoute les réponses correctes à une question
	 * @param idQuestion
	 * @param idReponses
	 * @return
	 * @throws Exception 
	 */
	public Question addReponsesCorrectesToQuestion(String idQuestion,List<String> idReponses) throws Exception;
	
	/**
	 * Removes the {@link Reponse} with the given id from the database
	 * @param idReponse
	 * @throws Exception 
	 */
	public void deleteReponse(String idReponse) throws Exception;

	/**
	 * Creates a new {@link Reponse} into database with the 
	 * given object.
	 * 
	 * @param question to be persisted
	 * @return persisted object.
	 * @throws Exception 
	 */
	public Reponse creerReponse(Reponse reponse) throws Exception;

	/**
	 * Met a jour une {@link Reponse}
	 * @param reponse
	 * @return persisted object.
	 * @throws Exception
	 */
	public Reponse modifierReponse(Reponse reponse) throws Exception;
	
	/**
	 * Creates a new {@link Categorie} into the database with the given object
	 * @param categorie
	 * @return
	 */
	public Categorie createCategorie(Categorie categorie) throws Exception;

	/**
	 * Removes the {@link Categorie} with the given Id from the database
	 * @param idCategorie
	 */
	public void deleteCategorie(String idCategorie) throws Exception;

}
